import { Controller, Post, HttpCode, Body } from '@nestjs/common';
import { UserService } from './user.service';
// import { User } from './user.entity';

@Controller('user')
export class UserController {
  constructor(private readonly userService: UserService) {}
  @Post('login')
  @HttpCode(200)
  async login(@Body('username') username: string) {
    return this.userService.login(username);
  }
  @Post('register')
  @HttpCode(200)
  async register(
    @Body('username') username: string,
    @Body('password') password: string,
  ) {
    return this.userService.register(username, password);
  }
}
